export default class common {
	constructor() {
		const Vue_ = arguments[0].prototype;
		Vue_.$formatCash = this.formatCash;
	}
	/**
	 * 金额转为千分符
	 */
	formatCash(num, decimalNumber) {
		num = num.toString().replaceAll(',', '');
		num = parseFloat(num);
		if (isNaN(num)) {
			num = parseFloat(num.toFixed(decimalNumber || 2));
			return num.toLocaleString();
		} else {
			return '0.00'
		}
	}
}
